package com.apotik.legenda.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name="apt_configs")
public class Config implements Serializable{
	private static final long serialVersionUID = 3448025803207298346L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="config_id")
	private Long configId;
	
	@Column(name="code_config", length=60, nullable = false)
	private String codeConfig;
	
	@Column(name="name_config", length=100, nullable = false, unique=true)
	private String nameConfig;
	
	@Column(name="value_1", length=250, nullable = false)
	private String value1;
	
	@Column(name="value_2", length=250)
	private String value2;
	
	@Column(name="value_3", length=250)
	private String value3;
	
	@Column(name="created_date", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date createdDate;
	
	@ManyToOne
	@JoinColumn(name="created_by", referencedColumnName = "user_id", nullable = false)
	private User createdBy;
	
	@Column(name="updated_date")
	@Temporal(TemporalType.TIMESTAMP)
	private Date updatedDate;
	
	@Column(name="is_active", nullable = false)
	private boolean isActive;
	

	public Long getConfigId() {
		return configId;
	}

	public void setConfigId(Long configId) {
		this.configId = configId;
	}

	public String getCodeConfig() {
		return codeConfig;
	}

	public void setCodeConfig(String codeConfig) {
		this.codeConfig = codeConfig;
	}

	public String getNameConfig() {
		return nameConfig;
	}

	public void setNameConfig(String nameConfig) {
		this.nameConfig = nameConfig;
	}

	public String getValue1() {
		return value1;
	}

	public void setValue1(String value1) {
		this.value1 = value1;
	}

	public String getValue2() {
		return value2;
	}

	public void setValue2(String value2) {
		this.value2 = value2;
	}

	public String getValue3() {
		return value3;
	}

	public void setValue3(String value3) {
		this.value3 = value3;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getUpdatedDate() {
		return updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public boolean isActive() {
		return isActive;
	}

	public void setActive(boolean isActive) {
		this.isActive = isActive;
	}

	public User getCreatedBy() {
		return createdBy;
	}
	
	public void setCreatedBy(User createdBy) {
		this.createdBy = createdBy;
	}
	
	
}
